package indzcraft.start;

import org.json.JSONException;

import indzcraft.calc.IndzCraftCalc;
import indzcraft.loader.*;
import indzcraft.ranking.Database;

public class IndzCraft {

	public static void main(String[] args) {
		new IndzCraft("eu","gorgonnash","indz");
	}
	
	IndzCraftLoader loader = null;
	IndzCraftCalc calc = null;
	Database db = null;
	//Ranking ranking = null;
	
	public IndzCraft(String region,String server, String name) {
		
		try {
			//loader = new IndzCraftLoader("nasuku","aman'thul","eu",true);
			//loader = new IndzCraftLoader("indz","gorgonnash","eu",true);
			loader = new IndzCraftLoader();
			db = new Database(loader);
			loader.setDatabase(db);
			loader.load2(name,server,region,true);
			//loader.getEquipment().print();
			BaseStats base = loader.getBase();
			calc = new IndzCraftCalc(loader, base);
			//String json = calc.getJSON();
			//ranking = new Ranking();

		} catch (JSONException e) {
			e.printStackTrace();
		}
	}
	
	public String getJSON(){
		return calc.getJSON();
	}

}
